<?php
class Jobeet {
	static public function slugify($text) {
		// replace all non letters or digits by -
		$text = preg_replace ( '/\W+/', '-', $text );
		
		// trim and lowercase
		$text = strtolower ( trim ( $text, '-' ) );
		
		$i = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ';
		$o = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr';
    	$text = strtr($text, utf8_decode($i), $o);
    	$text = strtolower($text);
		
		return (! empty ( $text ) ? $text : 'n-a');
	}
}